<template>
  <div>
    <el-form-item
      label="字段宽度:"
      prop="columnWidth"
      :rules="[
        { required: true, message: '请填写字段宽度', trigger: 'change' },
      ]"
    >
      <el-input-number
        controls-position="right"
        v-model="value.columnWidth"
        style="width: 200px"
        :min="1"
        :max="255"
      >
      </el-input-number>
      字符
    </el-form-item>
    <el-form-item label="字段编码:" prop="code">
      {{ value.code }}
    </el-form-item>
    <el-form-item
      label="列名:"
      prop="aliasName"
      :rules="[
        {
          required: true,
          message: '请填写列名',
          trigger: 'change',
        },
      ]"
    >
      <el-input
        v-model.trim="value.aliasName"
        style="width: 200px"
        placeholder="请输入"
      />
    </el-form-item>
    <el-form-item v-if="type === 'IMPORT'" label="是否必填:" prop="required">
      <el-checkbox
        :true-label="1"
        :false-value="0"
        v-model="value.required"
      >
      </el-checkbox>
    </el-form-item>
  </div>
</template>
<script>
export default {
  name: "CommonConfig",
  props: {
    value: {
      type: Object,
      default: () => {
        return {}
      },
    },
    type: {
      type: String,
      default: () => {
        return ""
      },
    },
  },
  data() {
    return {}
  },
  methods: {},
}
</script>
